package com.heima.wemedia.controller;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dto.WmLoginDto;
import com.heima.wemedia.service.WmUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@RestController
@RequestMapping(path = "/login")
@Api(value = "自媒体用户登录",description = "自媒体用户登录API",tags = "自媒体用户登录")
public class WmUserLoginController {

    @Resource
    private WmUserService wmUserService;

    /**
     * 自媒体登录接口
     *
     * @param dto
     * @return
     */
    @PostMapping(path = "/in")
    @ApiOperation("自媒体用户登录")
    public ResponseResult login(@RequestBody WmLoginDto dto) {
        Map<String, Object> result = wmUserService.login(dto);
        return ResponseResult.success(result);
    }
}
